// eslint-disable-next-line no-unused-vars
import VXETable, { Column } from 'vxe-table'
import dayjs from 'dayjs'
import 'dayjs/locale/zh-cn'
import relativeTime from 'dayjs/plugin/relativeTime'
dayjs.extend(relativeTime)

VXETable.renderer.add('TimeFrom', {
  renderDefault(h, renderOpts, { row, column }) {
    return dayjs()
      .locale('zh-cn')
      .from(row[column.property])
  }
})

/**@type { Column } */
export const options = {
  showOverflow: 'tooltip',
  align: 'left'
}
